export function bMapTransQQMap(lng, lat) {
  const x_pi = 3.141592653589793 * 3000.0 / 180.0
  const x = lng - 0.0065
  const y = lat - 0.006
  const z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi)
  const theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi)
  const lngs = z * Math.cos(theta)
  const lats = z * Math.sin(theta)

  return [lngs, lats]
}

export function qqMapTransBMap(lng, lat) {
  const x_pi = 3.141592653589793 * 3000.0 / 180.0
  const x = lng
  const y = lat
  const z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi)
  const theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi)
  const lngs = z * Math.cos(theta) + 0.0065
  const lats = z * Math.sin(theta) + 0.006

  return [lngs, lats]
}
